﻿Partial Class Document

    Public Class Body

        Public Section As Section
        Public Tables As New List(Of Table)

        Public Sub AddHeader(ByVal ParamArray Titles() As String)
            AddTable("1;c", "")
            Print("KKTC SOSYAL SİGORTALAR DAİRESİ")
            For Each Title As String In Titles
                Print("<+>" & Title)
            Next
            SkipLine()
        End Sub

        Public Sub AddDocHeader(ByVal ParamArray Titles() As String)
            AddTable("1;c", "")
            Print("<img><scale=3>amblem")
            Print("KKTC")
            Print("ÇALIŞMA VE SOSYAL GÜVENLİK BAKANLIĞI")
            Print("SOSYAL SİGORTALAR DAİRESİ")
            For Each Title As String In Titles
                Print("<+>" & Title)
            Next
            SkipLine()
        End Sub

        Sub AddTable(ByVal Columns As String, ByVal FontSize As String)
            Tables.Add(New Table(Section, FontSize))
            CurrentTable.AddColumns(Columns)
        End Sub

        ReadOnly Property CurrentTable() As Table
            Get
                Return Tables(Tables.Count - 1)
            End Get
        End Property

        Sub Print(ByVal ParamArray Params() As Object)
            CurrentTable.AddRow(Params)
        End Sub

        Sub SkipLine(Optional ByVal Count As Integer = 1)
            CurrentTable.SkipLine(Count)
        End Sub

        Sub Print(ByVal Info As PrintInfo)
            For Each Table As Table In Tables
                Table.Print(Info)
            Next
        End Sub

    End Class

End Class